package com.zmn.oms.services.impl.operator;

import com.zmn.common.utils.date.DateUtil;
import com.zmn.oms.model.entity.operator.OrderWorkOperator;
import com.zmn.oms.persistence.interfaces.operator.OrderWorkOperatorDao;
import com.zmn.oms.services.interfaces.operator.OrderWorkOperatorService;
import io.shardingsphere.api.HintManager;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author sunlife
 * @date:2021/9/15 5:16 下午
 * description:
 */
@Service
public class OrderWorkOperatorServiceImpl implements OrderWorkOperatorService {

    @Resource
    OrderWorkOperatorDao orderWorkOperatorDao;

    @Override
    public void insert(OrderWorkOperator operator) {
        orderWorkOperatorDao.insertSelective(operator);
    }

    @Override
    public OrderWorkOperator findByOrderIdAndWorkId(Long orderId, Long workId) {
        return orderWorkOperatorDao.findByOrderIdAndWorkId(orderId, workId);
    }

    @Override
    public List<OrderWorkOperator> listEsOrderWorkOperatorByOrderIdList(List<Long> orderIdList) {
        return orderWorkOperatorDao.listEsOrderWorkOperatorByOrderIdList(orderIdList);
    }

    @Override
    public void updateOrderWorkOperator(OrderWorkOperator orderWorkOperator) {
        orderWorkOperator.setUpdateTime(DateUtil.getNow());
        orderWorkOperatorDao.updateByPrimaryKeySelective(orderWorkOperator);
    }
}
